/*    */ package andriod.service;
/*    */ 
/*    */ import andriod.dao.PersistDao;
/*    */ import com.jcrj.entity.ODraftMail;
/*    */ import com.jcrj.entity.OInMail;
/*    */ import com.jcrj.entity.OMailReceiver;
/*    */ import java.util.List;
/*    */ 
/*    */ public class ArdMailService
/*    */ {
/*    */   private PersistDao persistDao;
/*    */ 
/*    */   public List<ODraftMail> getDraftMailList(int userId)
/*    */   {
/* 15 */     String hql = "from ODraftMail o where o.sendId=" + userId + 
/* 16 */       " order by o.createTime desc,o.id desc";
/* 17 */     return this.persistDao.find(hql);
/*    */   }
/*    */ 
/*    */   public long countDraftMail(int userId) {
/* 21 */     String hql = "select count(o.id) from ODraftMail o where o.sendId=" + 
/* 22 */       userId;
/* 23 */     return this.persistDao.findForLong(hql);
/*    */   }
/*    */ 
/*    */   public List<OMailReceiver> getInMailList(String userId) {
/* 27 */     String hql = " from OMailReceiver o where o.del='0' and o.receiverId in(" + 
/* 28 */       userId + ") order by o.inMail.createTime desc, o.ifRead asc";
/* 29 */     return this.persistDao.find(hql);
/*    */   }
/*    */ 
/*    */   public long countInMail(String userId) {
/* 33 */     String hql = "select count(o.id) from OMailReceiver o where o.del='0' and o.receiverId in(" + 
/* 34 */       userId + ") ";
/* 35 */     return this.persistDao.findForLong(hql);
/*    */   }
/*    */ 
/*    */   public List<OInMail> getSendMailList(int userId) {
/* 39 */     String hql = " from OInMail o where o.del='0' and o.sendId=" + userId + 
/* 40 */       " order by o.createTime desc,o.id desc";
/* 41 */     return this.persistDao.find(hql);
/*    */   }
/*    */ 
/*    */   public long countSendMail(int userId) {
/* 45 */     String hql = "select count(o.id) from OInMail o where o.del='0' and o.sendId=" + 
/* 46 */       userId;
/* 47 */     return this.persistDao.findForLong(hql);
/*    */   }
/*    */ 
/*    */   public List<OMailReceiver> getDeleteMailList(int userId) {
/* 51 */     String hql = " from OMailReceiver o where o.del='1' and o.receiverId=" + 
/* 52 */       userId + 
/* 53 */       " order by o.ifRead,o.inMail.createTime desc,o.id desc";
/* 54 */     return this.persistDao.find(hql);
/*    */   }
/*    */ 
/*    */   public long countDeleteMail(int userId) {
/* 58 */     String hql = "select count(o.id) from OMailReceiver o where o.del='1' and o.receiverId=" + 
/* 59 */       userId;
/* 60 */     return this.persistDao.findForLong(hql);
/*    */   }
/*    */ 
/*    */   public PersistDao getPersistDao() {
/* 64 */     return this.persistDao;
/*    */   }
/*    */ 
/*    */   public void setPersistDao(PersistDao persistDao) {
/* 68 */     this.persistDao = persistDao;
/*    */   }
/*    */ }

/* Location:           /Volumes/work/oa/WEB-INF/classes/
 * Qualified Name:     andriod.service.ArdMailService
 * JD-Core Version:    0.6.0
 */